<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
          integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
            integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
            crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
            integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
            crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
            integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
            crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
    <div class="col">
        <form action="/filterCPU/" method="post">
            {% csrf_token %}
            <table class="table table-hover">
                <tbody>
                <tr>
                    <th>品牌</th>
                    <td>
                        <select class="custom-select" name="Brand">
                            <option selected value="">选择品牌</option>
                            <option value="AMD">AMD</option>
                            <option value="Intel">Intel</option>
                        </select>
                    </td>
                </tr>

                <tr>
                    <th>适用平台</th>
                    <td>
                        <select class="custom-select" name="Platform">
                            <option selected value="">选择平台</option>
                            <option value="台式机">台式机</option>
                            <option value="笔记本">笔记本</option>
                        </select>
                    </td>
                </tr>

                <tr>
                    <th>核心数</th>
                    <td>
                        <select class="custom-select" name="CoreNumbers">
                            <option selected value="">选择核心数</option>
                            <option value="单">1</option>
                            <option value="双">2</option>
                            <option value="四">4</option>
                            <option value="六">6</option>
                            <option value="八">8</option>
                            <option value="十">10</option>
                            <option value="十二">12</option>
                            <option value="十四">14</option>
                            <option value="十六">16</option>
                            <option value="二十四">24</option>
                            <option value="三十二">32</option>
                            <option value="六十四">64</option>
                            <option value="九十六">96</option>
                        </select>
                    </td>
                </tr>

                <tr>
                    <th>插槽</th>
                    <td>
                        <select class="custom-select" name="Slot">
                            <option selected value="">选择插槽</option>
                            <option value="LGA 1700">LGA 1700</option>
                            <option value="LGA 1200">LGA 1200</option>
                            <option value="LGA 2066">LGA 2066</option>
                            <option value="LGA 1151">LGA 1151</option>
                            <option value="BGA">BGA</option>
                            <option value="Socket TR4">Socket TR4</option>
                            <option value="Socket sTRX4">Socket sTRX4</option>
                            <option value="Socket AM4">Socket AM4</option>
                            <option value="Socket AM3+">Socket AM3+</option>
                            <option value="Socket AM3">Socket AM3</option>
                        </select>
                    </td>
                </tr>

                <tr>
                    <th>内存规格</th>
                    <td>
                        <select class="custom-select" name="RAMType">
                            <option selected value="">选择支持的内存规格</option>
                            <option value="DDR4">DDR4</option>
                            <option value="DDR5">DDR5</option>
                        </select>
                    </td>
                </tr>
                </tbody>
                <tr>
                    <td></td>
                    <th>
                        <button type="submit" class="btn btn-primary">筛选</button>
                    </th>
                </tr>

            </table>
        </form>
    </div>
    <div class="col">
        {% for cpu in cpus %}
        <div class="card">
            <div class="card-body">
                <h5 class="card-title">{{cpu.Name}}</h5>
                <p class="card-text">适用平台:{{cpu.Platform}}</p>
                <p class="card-text">核心数:{{cpu.CoreNumbers}}</p>
                <p class="card-text">插槽:{{cpu.Slot}}</p>
                <p class="card-text">内存规格:{{cpu.RAMType}}</p>
                <p class="card-text">价格:￥{{cpu.Price}}</p>
                <div class="btn-group" role="group" aria-label="Basic example">
                    <form action="/configReturnCPU/" method="post">
                        {% csrf_token %}
                        <input name="id" hidden="hidden" value="{{cpu.Name}}">
                        <button type="submit" class="btn btn-primary">添加到配置单</button>
                    </form>
                    <form action="/moreInfoCPU/" method="post">
                        {% csrf_token %}
                        <input name="id" hidden="hidden" value="{{cpu.Name}}">
                        <button type="submit" class="btn btn-primary">详细信息</button>
                    </form>
                </div>
            </div>
        </div>
        {% endfor %}
    </div>
</div>
</body>
</html>